﻿using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

public class EditSteamAchievementWindow : EditorWindow
{

    private SteamAchievementModel source_model;

    private SteamAchievementModel target_model;
     
    public void Init(string ID,SteamAchievementData source,SteamAchievementData target) 
    {
        if (source.models.ContainsKey(ID))
            source_model = source.models[ID];
        else { 
            Close();
            return;
        }

        if (target.models.ContainsKey(ID))
            target_model = target.models[ID];
        else
        {
            Close(); 
        }
    }

    private void OnGUI()
    {

        EditorGUI.BeginDisabledGroup(true);

        EditorGUILayout.LabelField(string.Empty, "源名称", "BoldLabel");
        source_model.Name = EditorGUILayout.TextField(source_model.Name);

        EditorGUILayout.LabelField(string.Empty, "源描述", "BoldLabel");
        source_model.Des = EditorGUILayout.TextField(source_model.Des);

        EditorGUI.EndDisabledGroup();


        EditorGUILayout.LabelField(string.Empty, "目标名称", "BoldLabel");
        target_model.Name = EditorGUILayout.TextField(target_model.Name);

        EditorGUILayout.LabelField(string.Empty, "目标描述", "BoldLabel");
        target_model.Des = EditorGUILayout.TextField(target_model.Des);

    }

     
    private void OnLostFocus()
    {
        Close();
    }


}
